﻿/// <reference path="../GeneratedArtifacts/viewModel.js" />

myapp.AddEditOrderDetail.created = function (screen) {

    screen.findContentItem("ActiveProducts").dataBind("value.selectedItem", function (newValue) {
        if (newValue !== undefined && newValue !== null) {
            //Whenever selectedItem for Products changes, update the Product value on the main page 
            screen.OrderDetail.setProduct(newValue);

            //Close popup, if one is open. 
            screen.closePopup();
        }
    });
};